<?php

spl_autoload_register("bee_autoload");
/**
 * Includa odgovarajuću datoteku klase
 * @param $class_name
 */
function bee_autoload($class_name)
{ $cfg = bee\config::getInstance();
  $folder_list = bee\config::getInstance()->FOLDER_LIST;
  $class_name = str_replace("bee\\", "", $class_name);
  foreach ($folder_list as $folder)
  { //echo "?? " . $class_name . "  >  " . $folder . "/" . $class_name . ".php" . "::<br />\n";
    if(is_file( $folder . "/" . $class_name . ".php"))
    { if(include_once $folder . "/" . $class_name . ".php")
      { //echo "::" . $class_name . "  >  " . $folder . "/" . $class_name . ".php" . "::<br />\n";
        return;
      }
    }
  }
  if(bee\config::getInstance()->sys_AUTOLOAD_SHOW_WARNING)
  {  echo "\n<br />AUTOLOAD: $class_name NOT FOUND ";
  }
}